package old;
import java.io.File;
import java.io.IOException;

import oracle.OracleMove;
import oracle.Oracle;
import oracle.OracleTile;


public class Random {
	public static void main (String [] args) throws Exception{
		
		Oracle myOracle = new Oracle();
		myOracle.pathToWorld = "." + File.separator + "src" + File.separator + "world1" + File.separator;
		myOracle.initBoardInputs();
		System.out.println("Score is now :: " + myOracle.getCurrRoundScore());
		OracleTile myStart = myOracle.getCurrentTile();
		//System.out.println("Tile is ("+ myStart.row + ","+myStart.column + ") and value :: " + myStart.value);
		System.out.println(myStart.toString());
		System.out.println("Move number " + myOracle.getCurrMoveNumber() + " and moves remaining "+myOracle.getNumMovesLeftInRound());
		int move = 0;
		while(true){
			move = (int)(Math.random()*3)+1;
			//move = 1;
			OracleMove myMove = myOracle.makeMove(move);
			System.out.println(myMove.toString());
			OracleTile currLoc = myMove.newLocTile;
			System.out.println(currLoc.toString());
			//System.out.println("Tile is ("+ currLoc.row + ","+currLoc.column + ") and value :: " + currLoc.value);
		
			System.out.println("Score is now :: " + myOracle.getCurrRoundScore());
			System.out.println("Move number " + myOracle.getCurrMoveNumber() + " and moves remaining "+myOracle.getNumMovesLeftInRound());
			if(currLoc.isTerminalState){
				System.out.println("Reach terminal state. Mission Complete.");
				break;
			}
			if(!myOracle.isUserAlive){
				System.out.println("User dead. Mission failed.");
				break;
			}
		}		

	}
}
